#include <stdio.h>
int isPrime(int num) {
    if(num <= 1) {
        return 0;
    }
    for(int i = 2; i * i <= num; i++) {
        if(num % i == 0) {
            return 0;
        }
    }
    return 1;
}
int countPrimes(int n) {
    int count = 0;
    
    for(int i = 2; i <= n; i++) {
        if(isPrime(i)) {
            count++;
        }
    }
    return count;
}
int main() {
    int number;
    printf("Enter a number: ");
    scanf("%d", &number);
    
    int primeCount = countPrimes(number);
    printf("Number of primes: %d\n", primeCount);
    
    return 0;
}